package com.example.wlt.personnel_manegement_system.Manager.Org;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.TextView;

import com.example.wlt.personnel_manegement_system.R;

/**
 * Created by WLT on 2016/4/20.
 */
public class search extends Activity{
    private Button btn_back;//返回按钮
    private Button btn_searchcom;//完成搜索按钮
    private AutoCompleteTextView act_person;//自动匹配
    private TextView tv_head;
    //创建数据源
    private String[] name={"wangbing","wanglong","huangjing","xieyv","xiebing","xiefeng"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.search);
        btn_back=(Button)findViewById(R.id.btn_org_headleft);
        btn_searchcom=(Button)findViewById(R.id.btn_search_search);
        tv_head=(TextView)findViewById(R.id.tv_top_head);
        tv_head.setText("成员搜索");
        act_person=(AutoCompleteTextView)findViewById(R.id.act_search_person);
        //创建适配器
        ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,name);
        //加载适配器
        act_person.setAdapter(adapter);
        //进入相应部门页面
        btn_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        //完成搜索并进入所搜索人的个人信息页面
        btn_searchcom.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent Intent=new Intent(search.this,search_result.class);
                startActivity(Intent);
            }
        });
    }
}
